require 'active_connection/version'

module ActiveConnection
  class << self
    def schema_search_path(*paths, &block)
      original_search_path = ActiveRecord::Base.connection.schema_search_path
      ActiveRecord::Base.connection.schema_search_path = paths.join(',')
      yield
    ensure
      ActiveRecord::Base.connection.schema_search_path = original_search_path
    end
  end
end
